package com.qtenv.datasync.service.entity.msmapper;


import com.qtenv.datasync.service.entity.TerminalHistoryData;
import com.qtenv.datasync.service.entity.convert.DataMeterH;
import com.qtenv.datasync.service.entity.degao.DgTerminalHistory;
import com.qtenv.datasync.service.entity.ningbo.NingBoHistoryData;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

@org.mapstruct.Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface NingBoTerminalHistoryHMapper {
    NingBoTerminalHistoryHMapper INSTANCE = Mappers.getMapper(NingBoTerminalHistoryHMapper.class);

    @Mappings({
            @Mapping(source = "ningBoHistoryData.meterCode", target = "terminalID"),
            @Mapping(source = "ningBoHistoryData.currentReading", target = "totalFlow"),
            @Mapping(source = "ningBoHistoryData.pressure", target = "pressure"),
            @Mapping(source = "ningBoHistoryData.batteryVol", target = "terminalVol"),
            @Mapping(source = "ningBoHistoryData.signalStrength", target = "terminalCSQ"),
            @Mapping(source = "ningBoHistoryData.valveStatus", target = "valveState"),
            @Mapping(source = "ningBoHistoryData.readTime", target = "readDate"),
    })
    TerminalHistoryData toTerminalHistoryData(String tenantId, NingBoHistoryData ningBoHistoryData);
}
